/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csse3004.GD.WBUser;

import csse3004.GD.DA.WBUserDA;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;

/**
 *
 * @author s4223901 Lan Ye
 */
public class feedbackValidator {
    protected final Log log = LogFactory.getLog(getClass());
    private WBUserDA service = new WBUserDA();
    
    public boolean supports(Class type) {
        return feedbackController.class.equals(type) || feedbackController.class.equals(type);
    }
    public void validate(Object o, Errors errors) {
        feedback feedback = (feedback) o;
        String text = feedback.gettext();
        
        if(feedback.gettext().equals("")){
            errors.rejectValue("text","error.not-specified",null,"please fill in your comment and resubmit it.");
        }
        
    } 
}
